﻿using RAP.Framework.Libary.Utils;
using System.ComponentModel;
using RAP.Framework.Libary.DomTemplateBuilder.Attributes;
using RAP.Framework.Libary.DomTemplateBuilder.Handler;

namespace RAP.Framework.Libary.DomTemplateBuilder.Element.Collection
{
	/// <summary>
	/// 
	/// </summary>
	[Description ( "数据源InnerJoin循环" )]
    [TagHandler( "InnerJoin", typeof( InnerJoinIterateHandler ) )]
	public class InnerJoinIterate : Iterate
    {
		protected string _innerProperty = string.Empty;
		/// <summary>
		/// InnerJoin数据源的的属性名称或属性值（以逗号分割：1,2,3,4,5）
		/// </summary>
		public virtual string InnerProperty
		{
			get
			{
				if ( _innerProperty.IsNullOrEmpty ( ) )
				{
					_innerProperty = this.ToString ( "InnerProperty", string.Empty );
				}
				return _innerProperty;
			}
			set
			{
				this[ "InnerProperty" ] = _innerProperty = value;
			}
		}

		protected string _joinField= string.Empty;
		/// <summary>
		/// 在比较值时的属性名称，为空的话直接比较值
		/// </summary>
		public virtual string JoinField
		{
			get
			{
				if ( _joinField.IsNullOrEmpty ( ) )
				{
					_joinField = this.ToString ( "JoinField", string.Empty );
				}
				return _joinField;
			}
			set
			{
				this[ "JoinField" ] = _joinField = value;
			}
		}
    }
}
